<!DOCTYPE html>
<html th:lang="${language}" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <th:block th:include="include :: header(#{okr.my})" />
  <th:block th:include="include :: okr-css" />
</head>
<body class="gray-bg">
<div class="container-div">
  <div class="row" >

    <div class="col-sm-12 search-collapse">
      <form id="user-form">
        <div class="select-list">
          <ul>
            <li>
              登录名称：<input type="text" name="loginName"/>
            </li>
            <li>
              <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
              <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh" ></i>&nbsp;重置</a>
            </li>
          </ul>
        </div>
      </form>
    </div>
    <div class="col-sm-12 select-table table-striped">
      <table id="bootstrap-table"></table>
    </div>
  </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
  var prefix = ctx + "star";
  $(function(){
    var options = {
      url: prefix + "/list",
      showColumns: false,
      showRefresh: false,
      showSearch: false,
      showToggle: false,
      columns: [
        {
          field: 'userId',
          visible: false
        },
        {
          field: 'loginName',
          title: '登录名称',
          sortable: true
        },
        {
          field: 'userName',
          title: [[#{okr.userName}]]
        },
        {
          field: 'phonenumber',
          title: "电话号码"
        },
        {
          field: 'dept.deptName',
          title: '部门'
        },

        {
          field: 'operation',
          title: [[#{okr.operation}]],
          classes: 'col-xs-12',
          formatter: function (value, row, index){
            let actions = [];
            actions.push("<a class='btn btn-primary btn-xs' href='javascript:void(0)' onclick='queryOkr( " + row.userId + " )'><i class='fa fa-edit'></i>查询OKR</a>")
            return actions.join('')
          }
        }
      ]
    }
    $.table.init(options)
  })

  var cycleId = [[${cycleId}]]

  function queryOkr(userId){
    $.modal.openTab("查询关注成员Okr", ctx + "okr/info/viewUserOkrList/" + userId + "/" + cycleId)
  }

</script>
</body>
</html>